﻿using System;
using System.Data;
using System.Data.SqlClient;
using _DataProvider;

public partial class Admin_Parts_XemCTPDH : System.Web.UI.UserControl
{
    private SqlConnection connSql;
    protected void Page_Load(object sender, EventArgs e)
    {
        int MaPDH = int.Parse(Request.Params["MaPDH"]);
        DataTable dt = loadctpdh(MaPDH);
        DataList1.DataSource = dt;
        DataList1.DataBind();

    }

    public DataTable loadctpdh(int MaPDH)
    {
        DataProvider dt = new DataProvider();
        connSql = dt.connect();
        SqlDataAdapter daDepart = null;
        daDepart = new SqlDataAdapter("Select MaTaiLieu,ProductName,SoLuong,Giaban from CTPhieuDatHang,TaiLieu where TaiLieu.ProductID = CTPhieuDatHang.MaTaiLieu and MaPDH='" + MaPDH + "'", connSql);
        DataSet ds = new DataSet();
        daDepart.Fill(ds);
        return ds.Tables[0];
    }
}